<?php


namespace app\blog\controller;
use app\blog\model\Image as ImageModel;
use think\Controller;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\exception\DbException;
use think\facade\Log;

class Image extends Controller
{
        public function selectByAuthor($author){
            $data = new ImageModel();
            try {
                $data = $data->where("image_delete_time",null)->whereIn("image_member_name",$author)->order("image_onload_stamp desc")->selectOrFail();
            } catch (DataNotFoundException $e) {
            } catch (ModelNotFoundException $e) {
            } catch (DbException $e) {
                Log::warning("查询数据库错误");
            }
            return $data->toArray();
        }
}